package com.iwdm.renovation;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DBHelper extends SQLiteOpenHelper {
    public static final String name = "renovation.db";

    public DBHelper(Context context) {
        super(context, name, null, 1);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("create table IF NOT EXISTS user( name text UNIQUE,password text)");
        init(db);
    }

    @Override
    public void onUpgrade(SQLiteDatabase arg0, int arg1, int arg2) {
    }

    public void init(SQLiteDatabase db) {
        String temp = "INSERT INTO `user` (name,password) VALUES ('admin', 'admin123')";
        db.execSQL(temp);
    }
}
